﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using C.Entities;

namespace C.Unite
{
    public class DataHelper
    {
        /// <summary>
        /// 根据员工编号取得员工信息
        /// </summary>
        /// <param name="EmpNo">员工编号</param>
        /// <returns></returns>
        public static HR_EMP GetEmpInfo(string EmpNo)
        {
            HR_EMP hm = TbsDbSession.Default.From<HR_EMP>().Where(HR_EMP._.EMPLID == EmpNo).ToFirst();
            return hm;
        }
        /// <summary>
        /// 根据员工编号取得员工登录ID
        /// </summary>
        /// <param name="EmpNo">员工编号</param>
        /// <returns></returns>
        public static int GetEmpID(string EmpNo)
        {
            int empid = 0;
            Sys_Users hm = TbsDbSession.Default.From<Sys_Users>().Where(Sys_Users._.UserName == EmpNo).ToFirst();
            if (hm != null)
                empid = hm.UserID;
            return empid;
        }

    }
}
